Skip to content

Add report, bookmark functionality, and UI improvements#50

Merged
ujsquared merged 8 commits into
p-society:mainfrom
burgerphilic18:flag-mark
Apr 15, 2026
Merged

Add report, bookmark functionality, and UI improvements#50
ujsquared merged 8 commits into
p-society:mainfrom
burgerphilic18:flag-mark

Conversation

@burgerphilic18

Copy link
Copy Markdown
Contributor

This pull request introduces a bookmark system for threads and a post reporting system along with the necessary API endpoints for both users and admins.

Changed the authentication error for non-allowed email domains to redirect to the /login with an error query param.

Minor Frontend changes like improving responsiveness, visiblity and shifting position of buttons

Revamped login page UI

Signed-off-by: Spandan Hota <spandanhota2005@outlook.com>
Signed-off-by: Spandan Hota <spandanhota2005@outlook.com>
Signed-off-by: Spandan Hota <spandanhota2005@outlook.com>
Signed-off-by: Spandan Hota <spandanhota2005@outlook.com>
Signed-off-by: Spandan Hota <spandanhota2005@outlook.com>
Signed-off-by: Spandan Hota <spandanhota2005@outlook.com>
Signed-off-by: Spandan Hota <spandanhota2005@outlook.com>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces bookmarking and reporting features, including database schema updates, new API endpoints for admin and user actions, and corresponding frontend components. It also improves the authentication flow by redirecting unauthorized domains and adds automated tooltips for accessibility. Feedback was provided regarding the inconsistent use of server-side versus client-side timestamps for database updates and a suggestion to refactor string trimming logic for better readability.

return reply.status(403).send({ success: false, error: "Forbidden" });

const now = new Date().toISOString();
const now = sql`now()`;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using sqlnow()for thenowvariable inside a transaction is fine, but it is inconsistent with the use ofnew Date().toISOString()` elsewhere in the same file (e.g., in the draft publish route). It is better to use a consistent approach for timestamps to avoid potential timezone or format discrepancies.

const res = await api.createThread({
topicId: selectedTopicId,
threadTitle: title,
content: content.trim(),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The content field is being trimmed before being sent to the API. While this is good, the validation logic on line 59 already checks content.trim().length < 1. It would be cleaner to perform the trim once and store it in a variable before validation and API call.

@ujsquared
ujsquared merged commit 77e524c into p-society:main Apr 15, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants